package design.forkjoin;

import javax.swing.plaf.synth.SynthTextAreaUI;
import java.util.concurrent.RecursiveTask;
import java.util.concurrent.ThreadLocalRandom;

public class RecureiveTask1 extends RecursiveTask<Integer> {
    @Override
    protected Integer compute() {
        System.out.println("start compute : " + System.currentTimeMillis());
        try {
            Thread.sleep(ThreadLocalRandom.current().nextInt(2000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return ThreadLocalRandom.current().nextInt(5000);
    }
}
